package com.ushine.design.design.c_behavioral_pattern.k_visitor.b_example;

import java.util.ArrayList;

public class EmployeeList {
    private ArrayList<Employee> list = new ArrayList<>();

    public void addEmployee(Employee employee) {
        list.add(employee);
    }

    //遍历访问员工集合中的每一个员工对象
    public void accept(Department department) {
        list.forEach(value -> {
            value.accept(department);
        });
    }
}
